<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">

function search(form) {
	$(form).appendPagerParaStr();
	return true;
}

$(function(){
	$('.tipMe').tooltip({'placement':'top'});
 });

function deleteById(id){
	 parent.ui.confirm('确认删除?',function(){
		 $.ajax({
			   type: "POST",
			   dataType:"json",
			   cache: false,
			   url: _ctx + "/node/dataCategory_delete.do",
			   data: {id:id},
			   success: function(resp){
				   if(resp.status == '1'){
					   parent.ui.msg(resp.msg, 1);
					   ui.go(_ctx + '/node/dataCategory_list.do');
				   }else{
					   parent.ui.msg(resp.msg, 0);
				   }
			   },
			   error:function(){
				   ui.msg('信息加载错误', 0);
			   }
		}); 
	});	
}


function lockedById(id, name){
	 parent.ui.confirm('确认停用?',function(){
		 $.ajax({
			   type: "POST",
			   dataType:"json",
			   cache: false,
			   url: _ctx + "/node/lock_dataCategory_info.do",
			   data: {id:id, name:name},
			   success: function(resp){
				   if(resp.status == '1'){
					   parent.ui.msg(resp.msg, 1);
					   ui.go(_ctx + '/node/dataCategory_list.do');
				   }else{
					   parent.ui.msg(resp.msg, 0);
				   }
			   },
			   error:function(){
				   parent.ui.msg('信息加载错误', 0);
			   }
		}); 
	});	
}

function unLockedById(id, name){
	parent.ui.confirm('确认启用?',function(){
		 $.ajax({
			   type: "POST",
			   dataType:"json",
			   cache: false,
			   url: _ctx + "/node/unlock_dataCategory_info.do",
			   data: {id:id, name:name},
			   success: function(resp){
				   if(resp.status == '1'){
					   parent.ui.msg(resp.msg, 1);
					   ui.go(_ctx + '/node/dataCategory_list.do');
				   }else{
					   parent.ui.msg(resp.msg, 0);
				   }
			   },
			   error:function(){
				   parent.ui.msg('信息加载错误', 0);
			   }
		}); 
	});	
}

function domainInfoGet(id){
	$.ajax({
		   type: "GET",
		   dataType:"html",
		   cache: false,
		   url: _ctx + "/node/dataCategory_get.do",
		   data: {id:id},
		   success: function( content ){
			   $('#data').html( content ); 
			   var hiddenByClick = false;
			   window.parent.iframeModal("myModal", $('#myModal').html(), hiddenByClick);
		   },
		   error:function(){
			   ui.msg('信息加载错误', 0);
		   }
	});
}

</script>
</head>
<body>

<style type="text/css">
th{word-break: keep-all;white-space:nowrap;}
</style>
<body>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
		
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb" style="margin-left: 4px;">
						<li><i class="icon-home home-icon"></i>基础信息管理
						</li>
						<li>数据分类管理
						</li>
						<li class="active">列表</li>
					</ul>
				</div>

			<div class="page-content">
				<div class="row">
					<div class="col-xs-12">
						
						<div class="widget-box">
							<div class="widget-header widget-header-flat">
								<h5 class="smaller lighter">
									<i class="icon-list"></i> &nbsp;
								</h5>
								<div class="widget-toolbar no-border">
									<c:if test="${sessionScope._user_session.loginUser.superAdmin}">
										<a class="btn btn-primary btn-xs" href="${ctx}/node/dataCategory_add.do"><i class="icon-plus-sign"></i> 添加&nbsp;</a>
									</c:if>
										<a href="#" data-action="collapse">
										<i class="icon-chevron-up"></i>
									</a>
								</div>
							</div>

							<div class="widget-body">
								<div class="widget-main">
									<form  id="searchForm"  class="form-search"  action="${ctx}/node/dataCategory_list.do"  method="post">
										  <div class="row">
											    <div class="col-xs-4">
													<div class="input-group">
													    <span class="input-group-addon">数据分类名称</span>
													    <input type="text" class="form-control search-query" id="name" name="name"  value="${param.name}"/>
													    <span class="input-group-btn">
															<button type="submit" class="btn btn-purple btn-sm" onclick="return formSubmit();">
																<i class="icon-search icon-on-right bigger-110"></i>
																搜索
															</button>
														</span>
												   </div>
												</div>
											</div>
										</form>
								</div>
							</div>
						</div>
						
						<div class="hr hr12 hr-dotted"></div>
						
						<div class="table-responsive">
							<table id="sample-table-1" class="table table-striped table-bordered table-hover">
								<thead>
									<tr>
										<!-- <th class="center">
											<label>
											<input type="checkbox" class="ace" id="checkedAll"/>
											<span class="lbl"></span>
											</label>
										</th> -->
										<th class="center">序号</th>
										<th class="center">数据分类名称</th>
										<th class="center">所属业务域</th>
										<!--<th class="center">状态</th>-->
										<th class="center">备注</th>
										<th class="center">更新时间</th>										
										<th class="center">操作</th>
									</tr>
								</thead>

								<tbody>
									<c:forEach var="vo" items="${_data}" varStatus="varStatus">
									<tr>
										<%-- <td class="center">
											<label>
											<input type="checkbox" class="ace" value="${vo.name}"/>
											<span class="lbl"></span>
											</label>
										</td> --%>
										<td align="center">${varStatus.index + 1}</td>
										<td align="center">${vo.name}&nbsp;</td>
										<td align="center">${vo.domName}&nbsp;</td>
											<!--<td align="center">${vo.status eq "1" ? "可用" : "停用"}</td>-->
										<td align="center"><span class="tipMe" data-rel="tooltip" title="${vo.remark}">${cm:lmitStrPx(vo.remark,100)}&nbsp;</span></td>
										<td align="center"><fmt:formatDate value="${vo.mtime}" pattern="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>										
										<td align="center">
											<c:if test="${sessionScope._user_session.loginUser.superAdmin}">
											<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
												<a class="green" href="${ctx}/node/dataCategory_update.do?id=${vo.id}" title="修改">
													<i class="icon-pencil bigger-130"></i>
												</a>
													<!--
												<c:choose>
														<c:when test="${'1' eq vo.status}">
															<a name="notAdminButton" class="red tipMe" href="javascript:void(0);" 
																title="停用" onclick="lockedById('${vo.id}', '${vo.name}');"> <i
																class="icon-lock bigger-130"></i> </a>
														</c:when>
														<c:otherwise>
															<a name="notAdminButton" class="green tipMe" href="javascript:void(0);" 
																title="启用" onclick="unLockedById('${vo.id}', '${vo.name}');"> <i
																class="icon-unlock bigger-130"></i> </a>
														</c:otherwise>
													</c:choose>-->
													<a class="red" href="javascript:void(0)" onclick="deleteById('${vo.id}');" title="删除">
														<i class="icon-trash bigger-130"></i>
													</a>
											</div>
											</c:if>
										</td>
									</tr>
									</c:forEach> 
								</tbody>
							</table>
							<jsp:include page="/WEB-INF/view/common/pg.jsp">
								<jsp:param value="${ctx}/node/dataCategory_list.do" name="url"/>
								<jsp:param value="${_total}" name="total"/>
								<jsp:param value="${_urlpara}" name="urlpara" />
							</jsp:include>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>
